<!DOCTYPE html>
<html>
<#include "../head.html">
    <body>
    <table class="mc">
        <tr>
            <td class="mc-l">
                <!--左侧导航---{-->
                <div id="navPanelContainer">
                    <div class="system-logo cd"></div>
                    <!--管理员信息---{-->
                    <#include "../adminInfo.html">
                        <!--管理员信息---}-->
                        <div class="nav-wrap">
                            <#include "../borrow/left.html">
                        </div>
                </div>
                <!--左侧导航---}-->
            </td>
            <td class="mc-m">
                <div class="navToggle"></div>
            </td>
            <td class="mc-r">
                <!--顶部导航---{-->
                <#include "../topNav.html">
                    <!--顶部导航---}-->

                    <!--面包屑导航---{-->
                    <#assign moduleName="理财宝信息修改">
                        <#include "../borrow/banner.html">
                            <!--面包屑导航---}-->

                            <!--工具栏--{-->
                            <div id="toolbar" class="clearfix">
		                         <div class="toolbor-module">
							        <input type="button" class="input-button return" value="返回" onclick="history.go(-1)">
							    </div>
                            </div>
                            <!--工具栏--}-->

                            <div id="main" class="clearfix">
                                <form name="form1" method="post" action="/admin/treasure/edit.html" onsubmit="return check_form();" enctype="multipart/form-data" >
                                    <div class="valBox" style="margin-bottom:20px;">
                                        <div class="top">
                                            <strong>理财宝信息修改</strong>
                                        </div>
                                        <div class="title-v edit edit_ul clearfix">
                                            <ul>
                                             <li>
                                                    <div class="title"><font color="red">发布者用户名</font>：</div>
                                                    <div class="v">${item.username}</div>
                                                </li>
                                                <li>
                                                    <div class="title">理财宝名：</div>
                                                    <div class="v"><input name="name" id="name" value="${item.name}"/><font id="name_" color="red"></font></div>
                                                </li>
                                                <li>
                                                    <div class="title">理财宝总额：</div>
                                                    <div class="v"><input name="account" id="account" value="${item.account?c}"/>(单位：元)<font id="account_" color="red"></font></div>
                                                </li>
                                                 <li  class="color">
                                                    <div class="title">单人最多投资额度:</div>
                                                    <div class="v"><input name="most_account" id="most_account" value="${item.most_account?c}"/>(单位：元)<font id="most_account_" color="red"></font></div>
                                                </li>
                                                 <li  class="color">
                                                    <div class="title">单笔最高投资额度:</div>
                                                    <div class="v"><input name="max_account" id="max_account" value="${item.max_account?c}"/>(单位：元)<font id="max_account_" color="red"></font></div>
                                                </li>
                                                <li  class="color">
                                                    <div class="title">单笔最低投资额度:</div>
                                                    <div class="v"><input name="min_account" id="min_account" value="${item.min_account?c}"/>(单位：元)<font id="min_account_" color="red"></font></div>
                                                </li> 
                                                <li>
                                                    <div class="title">理财宝投资限制：</div>
                                                    <div class="v">
                                                    	<input name="rule_check" id="rule_check" value="${item.rule_check}" type="text"/>&nbsp;&nbsp;&nbsp;<font id="rule_check_" color="red">可为空，不为空时请谨慎填写此条信息。</font>
                                                    </div>
                                                </li>
                                                 <li class="color">
                                                    <div class="title">天利率：</div>
                                                    <div class="v"><input name="apr" value="${item.apr}" id="apr"/>&nbsp;%&nbsp;保留两位小数。<font id="apr_" color="red"></font></div>
                                                </li>
                                                 <li class="color">
                                                    <div class="title">利息管理费利率：</div>
                                                    <div class="v"><input name="manager_apr" value="${item.manager_apr}" id="manager_apr"/>&nbsp;%&nbsp;保留两位小数。<font id="apr_" color="red"></font></div>
                                                </li>
                                                   
                                                <li class="color">
                                                    <div class="title">已投资总额度：</div>
                                                    <div class="v">${item.invest!}元</div>
                                                </li>
                                                <li class="color">
                                                    <div class="title">生息间隔时间：</div>
                                                    <div class="v">
                                                        <#if item.interest_time == 0>即时生息<#else>${item.interest_time?c}天后</#if>
                                                    </div>
                                                </li>
                                                <li>
                                                    <div class="title">利息计算周期：</div>
                                                    <div class="v">
                                                        <#if item.interest_cycle == 0>不启用<#else>${item.interest_cycle?c}天</#if>
                                                    </div>
                                                </li>
                                                <li>
                                                    <div class="title">借款时间：</div>
                                                    <div class="v">
                                                        <#if item.time_limit == 0>不限期<#else>${item.time_limit!}<#if item.time_limit_type == 1>天<#elseif item.time_limit_type == 2>月<#elseif item.time_limit_type == 3>年</#if></#if>
                                                    </div>
                                                </li>           
                                                <li>
                                                    <div class="title">还款方式：</div>
                                                    <div class="v">
                                                        <#if item.style==0>用户自主赎回<#else>到时一次性还款</#if>
                                                    </div>
                                                </li>     
                                                <li>
                                                    <div class="title">赎回方式：</div>
                                                    <div class="v">
                                                    	<#if item.back_type == 0>投资份额赎回<#else>用户资金余额赎回</#if>
                                                    </div>
                                                </li>
                                                 <li>
                                                    <div class="title">赎回限制时间：</div>
                                                    <div class="v">
                                                    <#if item.back_time == 0>随时提取<#else>${item.back_time?c}天</#if>
                                                    </div>
                                                </li>
                                                <li>
                                                    <div class="title">赎回审核类型：</div>
                                                    <div class="v">
                                                    	<#if item.back_verify_type == 0>无需审核<#elseif item.back_verify_type == 1>一审<#elseif item.back_verify_type == 2>一审二核</#if>
                                                    </div>
                                                </li>  
                                                <li class="color">
                                                	 <div class="title">理财宝简介:</div>
                                                    <div class="v">
                                                       <textarea rows="6" cols="100" maxlength="255" name="describe" id="describe" style="width: 600px; height: 120px;">${item.describe!""}</textarea><font id="describe_" color="red"></font>
                                                    </div>
                                                </li> 
                                                <li>
                                                     <div class="title">理财宝详情：</div>
                                                     <div class="v">
                                                         <!-- 插入百度编辑器  -->
														<#include "../../common/ueditor.html"> 
														<@showUeditor width=680 heigth=100 id="content" name="content" content="${item.content}" /> 
                                                     </div>
                                                 </li> 
                                                <li class="color"></li>
                                            </ul>
                                        </div>
                                        </div>
                                      
                                      <div id="bottomToolbar" class="clearfix">
			                                <input type="hidden"  name="id" value="${item.id?c!0}" />
			                                <input class="input-button post" type="submit" name="submit" value="提交" />
			                            </div>
                                </form>
                            </div>
            </td>
        </tr>
        <tr>
            <!--尾部--{-->
            <td colspan="3" class="mc-b"><#include "../foot.html"></td>
            <!--尾部--}-->
        </tr>
    </table>

    </body>
    <div class="msgClass">
      ${rsmsg!""}
 </div>
</html>
<#include "../jsPage.html">
<script>
	function check_form(){
		 var frm = document.forms['form1'];
		 var result = true;
		 
		 var name = frm.elements['name'].value;
		 if (result && name.length == 0 ) {
			  result =false;
			  document.getElementById('name_').innerHTML = " 理财宝名不能为空。";
		  }
		  if (result && name.length > 255 ) {
			  result =false;
			  document.getElementById('name_').innerHTML = " 理财宝名不能超过255个字符。";
		  }
		  
		  var most_account = frm.elements['most_account'].value;
		  var mostAccount = parseFloat(most_account);
		  if(result && (mostAccount == null || mostAccount < 0 )){
			  result =false;
			  document.getElementById('most_account_').innerHTML = " 理财宝单人最多投资额度不能为空，为零，代表无此限制。";
		  }
		  
		  var min_account = frm.elements['max_account'].value;
		  var minAccount = parseFloat(min_account);
		  if(result && (minAccount == null || minAccount < 0 )){
			  result =false;
			  document.getElementById('min_account_').innerHTML = " 理财宝单笔最低投资额度不能为空，为零，代表无此限制。";
		  }
		  
		  var min_account = frm.elements['min_account'].value;
		  var minAccount = parseFloat(min_account);
		  if(result && (minAccount == null || minAccount < 0 )){
			  result =false;
			  document.getElementById('min_account_').innerHTML = " 理财宝单笔最低投资额度不能为空，为零，代表无此限制。";
		  }
		  
		  var account = frm.elements['account'].value;
		  var sumAccount = parseFloat(account);
		  if(result && (sumAccount == null || sumAccount < 0) ){
			  result =false;
			  document.getElementById('account_').innerHTML = " 理财宝总额度不能为空，为零，代表无此限制。";
		  }
		  
		  var content = frm.elements['content'].value;
		  if (result && (content == null || content.length == 0 )) {
			  result =false;
			  document.getElementById('content_').innerHTML = " 理财宝详情不能为空。";
		  }
		  if (result && content.length > 255 ) {
			  result =false;
			  document.getElementById('content_').innerHTML = " 理财宝详情不能超过255个字符。";
		  }
		  if (!result){
			return false;
		  } else{ 
			  return true;
		  }
	}
</script>